#ifndef _CM0_UART_H
#define _CM0_UART_H

#include "CMSDK_CM0.h"

/* UART struct name overwrite */
typedef struct {
	uint32_t UART_Bauddiv;
	uint32_t UART_WorkCtrl;
	uint32_t UART_IRQ;
}UART_InitTypeDef;

#define UART0                  CMSDK_UART0
#define UART1                  CMSDK_UART1
#define UART2                  CMSDK_UART2

/* UART init value define */
#define UART_WorkCtrl_TX                      ((uint32_t)0x01)
#define UART_WorkCtrl_RX                      ((uint32_t)0x02)

#define UART_IRQ_TX                           ((uint32_t)0x04)
#define UART_IRQ_RX                           ((uint32_t)0x08)
#define UART_IRQ_TXOR                         ((uint32_t)0x10)
#define UART_IRQ_RXOR                         ((uint32_t)0x20)

/* UART function */
void UART_Init(CMSDK_UART_TypeDef * UARTx, UART_InitTypeDef * pUART);
#endif
